﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;

namespace FinalProject.UI
{
    public class FormValidation
    {
        public static void DisplayWarning(Control control, string message)
        {
            if (control != null)
            {
                Style warningStyle = System.Windows.Application.Current.TryFindResource("WarningStyle") as Style;
                if (warningStyle != null)
                {
                    control.Style = warningStyle;
                    control.ToolTip = new ToolTip()
                    {
                        Content = message
                    };
                }
            }
        }

        public static void RemoveWarning(Control control)
        {
            if (control != null)
            {
                control.Style = null;
                control.ToolTip = null;
            }
        }

    }
}
